function idxUp=detectorPuntosSubidaCOSS(data,breakPoints,days)
    apertura=data(:,2);
    high=data(:,3);
    low=data(:,4);
    cierre=data(:,5);

    % Codificar la secuencia
    percentageCierre=[0; cierre(2:end)./cierre(1:(length(cierre)-1))];
    encodedCierre=zeros(size(percentageCierre));
    N=length(breakPoints);
    for i=1:length(cierre)
        v=percentageCierre(i);
        for j=1:N
            if v<breakPoints(j)
                encodedCierre(i)=j;
                break;
            end
        end
        if encodedCierre(i)==0
            encodedCierre(i)=N+1;
        end
    end
    
    % Formar itemsets
    itemset={};
    diaAlcista=100;
    days_1=days-1;
    for i=days:(length(cierre)-1)
        idxItemset=i-days_1;
        itemset{idxItemset}.tid=i;
        itemset{idxItemset}.items=[];
        for jj=0:days_1
            offset=1000*jj;
            itemset{idxItemset}.items=[itemset{idxItemset}.items offset+encodedCierre(i-jj)];
            if cierre(i-jj)>apertura(i-jj)
                itemset{idxItemset}.items=[itemset{idxItemset}.items offset+diaAlcista];
            end
        end
         itemset{idxItemset}.items=sort( itemset{idxItemset}.items);
    end
    
    % [Extraer patrones]/Detectar patrones
    idxUp=[];
    for i=1:length(itemset)
        % 6, 100, 1001, 2001
        if length(find(itemset{i}.items==6))>0 && ...
           length(find(itemset{i}.items==100))>0 && ...
           length(find(itemset{i}.items==1001))>0 && ...
           length(find(itemset{i}.items==2001))>0
           idxUp=[idxUp itemset{i}.tid];
        end
    end
end
